<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>骡窝窝系统管理平台</title>
    <#include "../common/header.ftl"/>

    <script type="text/javascript">
        $(function(){
                //模态框
            $('.showBtn').click(function () {
                var id = $(this).data("tid");
                $.get("/travel/getContentById.do",{id:id},function (data) {
                    $(".modal-body").html(data.content);
                });
                $('#showModal').modal('show');
            });
    $('.changeStateBtn').click(function () {
        var id = $(this).data("tid");
        var state = $(this).data("state");
        $.get("/travel/changeStateById.do",{id:id,state:state},function (data) {
           if(data.success){
               window.location.reload();
           }
        });
    });
        });
    </script>
</head>

<body>
<div class="container">
<#include "../common/top.ftl"/>
    <div class="row">
        <div class="col-sm-3">
		<#assign currentMenu = "audit_list" />
				<#include "../common/menu.ftl" />
        </div>
        <div class="col-sm-9">
            <div class="page-header">
                <h3>平台用户管理</h3>
            </div>
            <div class="row">
                <!-- 提交分页的表单 -->
                <form id="searchForm" class="form-inline" method="post" action="/travel/audit_list.do">
                    <input type="hidden" name="currentPage" id="currentPage" value="1"/>
                    <div class="form-group">
                    </div>
                    <div class="form-group">
                        <label>关键字</label>
                        <input class="form-control" type="text" name="keyword" value="${(qo.keyword)!''}">
                    </div>
                    <div class="form-group">
                        <button id="query" type="button" class="btn btn-success"><i class="icon-search"></i> 查询</button>
                    </div>
                </form>
            </div>
            <div class="row">
                <table class="table">
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>标题</th>
                        <th>封面</th>
                        <th>地点</th>
                        <th>作者</th>
                        <th>状态</th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>
					<#list pageInfo.list as vo>
                    <tr>
                        <td>${vo_index+1}</td>
                        <td>${vo.title!""}</td>
                        <td><img src='${vo.coverUrl!""}' width="30px"/></td>
                        <td>${vo.place.name!""}</td>
                        <td>${vo.author.nickName!""}</td>
                        <td>
                        <#if vo.state == -1>
                            已拒绝
                        <#elseif vo.state == 0>
                            草稿
                        <#elseif vo.state == 1>
                            待发布
                        <#elseif vo.state == 2>
                            已发布
                        <#elseif vo.state == 3>
                            已发布
                        </#if>
                        </td>
                        <td>
                            <a href="javascript:" class="btn btn-info btn-xs showBtn" data-tid="${vo.id}">
                                <span class="glyphicon glyphicon-pencil"></span> 查看内容
                            </a>
                        <a href="javascript:" class="btn btn-primary  btn-xs changeStateBtn" data-tid="${vo.id}" data-state="2">
                            <span class="glyphicon glyphicon-pencil"></span> 发布
                        </a>
                        <a href="javascript:" class="btn btn-success btn-xs changeStateBtn" data-tid="${vo.id}" data-state="-1">
                            <span class="glyphicon glyphicon-pencil"></span> 拒绝
                        </a>
                       </td>
                    </tr>
					</#list>
                    </tbody>
                </table>
            <#include "../common/page.ftl"/>

            </div>
        </div>
    </div>
</div>


<div class="modal fade" id="showModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">查看内容</h4>
            </div>
            <div class="modal-body">

            </div>

        </div>
    </div>
</div>
<style>
    #showModal img{
        width:100%
    }
    #showModal  .modal-body{
        max-height: 600px;
        overflow-y: auto;
    }

</style>
</body>
</html>